Copies the collection objects to a one-dimensional
System.Array instance beginning at the specified index.
Syntax
'Declaration
Public Sub CopyTo( _
ByVal () As , _
ByVal As Integer _
)
'Usage
Dim instance As CollectionBase(Of T)
Dim array() As
Dim index As Integer
instance.CopyTo(array, index)
public void CopyTo(
[] ,
int
)
Parameters
- array
- The one-dimensional System.Array that is the destination of the values copied from the collection.
- index
- The index of the array at which to begin inserting.
Exceptions
Exception | Description |
System.ArgumentNullException | The array parameter is null. |
System.ArgumentOutOfRangeException | The index parameter is less than the target array's minimum index. |
System.ArgumentException | The destination array is multidimensional.-or- The number of elements in the Collection<T> is greater than the available space between the index of the target array specified by the index parameter and the end of the target array. |
See Also